import utils from "../utils/utils";

// index.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
    imgList: [
      'https://changle-oss.oss-cn-hangzhou.aliyuncs.com/boothImg/876159276899368960.png',
      'https://img0.baidu.com/it/u=1650612162,1547749329&fm=253&fmt=auto&app=138&f=JPEG?w=640&h=320',
      'https://img0.baidu.com/it/u=3830083417,1769929952&fm=253&fmt=auto&app=138&f=JPEG?w=499&h=182'
    ],
    aiFunction: [{
        name: "文案提取",
        picImage: "https://changle-oss.oss-cn-hangzhou.aliyuncs.com/boothImg/876873017672597504.png",
        method: "textToExtraction",
        navigateTo: "/pages/convert/index",
        parameter: "",
      },
      {
        name: "去水印",
        picImage: "https://changle-oss.oss-cn-hangzhou.aliyuncs.com/boothImg/876872641523220480.png",
        method: "textToExtraction",
        navigateTo: "/pages/convert/index",
        parameter: "",
      }, {
        name: "文字配音",
        picImage: "https://changle-oss.oss-cn-hangzhou.aliyuncs.com/boothImg/876876900826349568.png",
        method: "textToExtraction",
        navigateTo: "/pages/convert/index",
        parameter: "",
      }, {
        name: "文字图片",
        picImage: "https://changle-oss.oss-cn-hangzhou.aliyuncs.com/boothImg/876873866209656832.png",
        method: "textToExtraction",
        navigateTo: "/pages/convert/index",
        parameter: "",
      }, {
        name: "文字视频",
        picImage: "https://changle-oss.oss-cn-hangzhou.aliyuncs.com/boothImg/876874729514860544.png",
        method: "textToExtraction",
        navigateTo: "/pages/convert/index",
        parameter: "",
      }, {
        name: "音量变大",
        picImage: "https://changle-oss.oss-cn-hangzhou.aliyuncs.com/boothImg/876877700969529344.png",
        method: "textToExtraction",
        navigateTo: "/pages/convert/index",
        parameter: "",
      }
    ],
    listArr: [{
        "id": "260",
        "title": "uniapp+vue3\u7248\u7684\u65b0\u9879\u76ee\u201c\u54b8\u867e\u7c73\u58c1\u7eb8\u201d\u5df2\u7ecf\u4e0a\u7ebf\u5566",
        "picurl": "http:\/\/qingnian8.oss-cn-qingdao.aliyuncs.com\/images\/20231112\/1699775864.jpg",
        "posttime": "1699774729",
        "hits": "38597",
        "classid": "50",
        "author": "\u54b8\u867e\u7c73"
      },
      {
        "id": "259",
        "title": "\u2605 \u53d1\u5e03\u7684uniapp\u548cuniCloud\u8bfe\u7a0b\uff0c\u83b7\u5f97\u4e86\u5b98\u65b9\u63a8\u8350",
        "picurl": "http:\/\/qingnian8.oss-cn-qingdao.aliyuncs.com\/images\/20221228\/1672226615.jpg",
        "posttime": "1672216885",
        "hits": "149099",
        "classid": "50",
        "author": "\u54b8\u867e\u7c73"
      },
      {
        "id": "251",
        "title": "\u9999\u6e2f\u6052\u5927\u4e2d\u5fc3\u518d\u6b21\u653e\u552e \u674e\u5609\u8bda\u65d7\u4e0b\u957f\u5b9e\u96c6\u56e2\u4ecd\u6709\u673a\u4f1a",
        "picurl": "http:\/\/qingnian8.oss-cn-qingdao.aliyuncs.com\/images\/20220926\/1664178169.jpg",
        "posttime": "1664174668",
        "hits": "114131",
        "classid": "50",
        "author": "\u9648\u4e1a"
      },
      {
        "id": "248",
        "title": "\u51fb\u8d25\u65e5\u97e9\uff0c\u56fd\u4ea7\u65b0\u80fd\u6e90\u8f66\u6253\u5165BBA\u8001\u5de2\uff0c\u7535\u52a8\u8f66\u5927\u6218\u4e00\u89e6\u5373\u53d1\uff1f",
        "picurl": "http:\/\/qingnian8.oss-cn-qingdao.aliyuncs.com\/images\/20220916\/1663315074.jpg",
        "posttime": "1663310416",
        "hits": "70575",
        "classid": "50",
        "author": "\u5149\u5b50\u51fa\u884c"
      },
      {
        "id": "247",
        "title": "\u4e2d\u56fd\u201c\u679c\u94fe\u201d\u4e0b\u5357\u6d0b\uff1a\u5370\u5ea6\u672c\u571f\u5de8\u5934\u8981\u62a2\u593a\u4e2d\u56fd\u4f01\u4e1a\u7684\u996d\u7897\uff1f",
        "picurl": "http:\/\/qingnian8.oss-cn-qingdao.aliyuncs.com\/images\/20220916\/1663314010.jpg",
        "posttime": "1663310296",
        "hits": "51026",
        "classid": "50",
        "author": "\u5e02\u573a\u89c2\u5bdf"
      },
      {
        "id": "246",
        "title": "\u8f9b\u5df4\u4e3e\u62a5\u540c\u884c\u80cc\u540e\u7684\u660e\u661f\u5e26\u8d27\uff1a\u4e0a\u5348\u770b\u8d27\u4e0b\u5348\u5c31\u64ad\uff0c\u6fc0\u60c5\u8bdd\u672f\u5168\u9760\u6f14\u6280",
        "picurl": "http:\/\/qingnian8.oss-cn-qingdao.aliyuncs.com\/images\/20220916\/1663314476.jpg",
        "posttime": "1663310217",
        "hits": "33027",
        "classid": "50",
        "author": "\u5468\u709c\u7693"
      },
      {
        "id": "245",
        "title": "\u6559\u80b2\u90e8\uff1a\u5df2\u53d6\u6d885\u7c7b\u5168\u56fd\u6027\u9ad8\u8003\u52a0\u5206\u9879\u76ee\uff0c\u5305\u62ec\u4f53\u80b2\u7279\u957f\u751f\u7b49",
        "picurl": "http:\/\/qingnian8.oss-cn-qingdao.aliyuncs.com\/images\/20220916\/1663316533.jpg",
        "posttime": "1663310088",
        "hits": "21941",
        "classid": "50",
        "author": "\u754c\u9762\u65b0\u95fb"
      },
      {
        "id": "244",
        "title": "\u56fd\u6709\u5927\u884c\u5f00\u59cb\u5c0f\u8303\u56f4\u5185\u6d4b\u9996\u6279\u4e2a\u4eba\u517b\u8001\u91d1\u8d26\u6237 \u5177\u4f53\u7cfb\u7edf\u642d\u5efa\u8fd8\u5728\u8fdb\u7a0b\u4e2d",
        "picurl": "http:\/\/qingnian8.oss-cn-qingdao.aliyuncs.com\/images\/20220916\/1663311879.jpg",
        "posttime": "1663309739",
        "hits": "16395",
        "classid": "50",
        "author": "\u8d22\u8054\u793e"
      }
    ],
    dataList: [{
      "data": [{
          "id": "572382181955813376",
          "title": "文案提取",
          "src": "/img/文案提取.png",
        },
        {
          "id": "572382181955813376",
          "title": "去水印",
          "src": "/img/去水印.png",
        }, {
          "id": "572382181955813376",
          "title": "文字配音",
          "src": "/img/文字配音.png",
        }, {
          "id": "572382181955813376",
          "title": "文字图片",
          "src": "/img/文字图片.png",
        },{
          "id": "572382181955813376",
          "title": "文字视频",
          "src": "/img/文字视频.png",
        },{
          "id": "572382181955813376",
          "title": "音量变大",
          "src": "/img/音量变大.png",
        },
      ],
    }, ]
  },


  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {},

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {},

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {},

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {},

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {},

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {},

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {},

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {},

  navigateTo(e){
    let transferData = e.currentTarget.dataset.item;
    let navigateToUrl = e.currentTarget.dataset.item?.navigateTo
    if (!navigateToUrl) {
      wx.showToast({
        title: '未查到对应页面',
        icon: "none"
      })
      return
    }
    // console.log(navigateToUrl)
    // wx.navigateTo({
    //   url: '/pages/convert/index',
    //   events: transferData
    // })
    utils.jumpPage(navigateToUrl,transferData);
  }
})